<?php include "../public/header.php";?>
<?php include "../public/header_edit.php";?>
<link rel="stylesheet" type="text/css" href="/static/component/laytp/module/cityPicker/city-picker.css">

<body id="optPage">
<form class="layui-form layui-form-pane" id="commentForm">
    <div class="page-title">
        <div class="page-title-con">
            <span>配置默认项目管理组</span>
            <span style="font-weight: 200!important;font-size: 14px">最后编辑人：<span style="margin-right: 20px" id="man_created_user"></span>最后编辑时间：<span id="man_created_at"></span></span>
            <div class="move_title"></div>
            <div class="page-title-opt-list">
                <button type="button" class="layui-btn layui-btn-sm btn-dark marginr5" lay-submit="" lay-filter="add">提交</button>
            </div>
        </div>
    </div>
    <div class="main-container">

        <div class="block-first">
            <div style="font-size: 18px;font-weight: bold;text-align: center;margin-bottom: 20px">项目管理组-自营项目</div>
            <div class="layui-form-item">
                <div class="layui-row layui-col-space10">
                    <div class="layui-col-md12">
                        <label class="layui-form-label">项目专管员</label>
                        <div class="layui-input-block">
                            <div class="tanxian">
                                <div class="tanxianclick" onclick="openPage('../public/choose_userpart.php?dom=man_zhuan&type=user&single=2', '770px', '490px');"></div>
                                <div class="tanxiannei" id="man_zhuan"></div>
                            </div>
                            <div class="tancheckdiv"><div class="tancheck" onclick="openPage('../public/choose_userpart.php?dom=man_zhuan&type=user&single=2', '770px', '490px');"><i class="layui-icon layui-icon-search"></i></div></div>
                            <div id="man_zhuan_tanerror" class="tanerrormsg"></div>
                        </div>
                    </div>
                </div>
            </div>
            <div class="layui-form-item">
                <div class="layui-row layui-col-space10">
                    <div class="layui-col-md12">
                        <label class="layui-form-label">资料专员</label>
                        <div class="layui-input-block">
                            <div class="tanxian">
                                <div class="tanxianclick" onclick="openPage('../public/choose_userpart.php?dom=man_zi&type=user&single=2', '770px', '490px');"></div>
                                <div class="tanxiannei" id="man_zi"></div>
                            </div>
                            <div class="tancheckdiv"><div class="tancheck" onclick="openPage('../public/choose_userpart.php?dom=man_zi&type=user&single=2', '770px', '490px');"><i class="layui-icon layui-icon-search"></i></div></div>
                        </div>
                    </div>
                </div>
            </div>
            <div class="layui-form-item">
                <div class="layui-row layui-col-space10">
                    <div class="layui-col-md12">
                        <label class="layui-form-label">成本专员</label>
                        <div class="layui-input-block">
                            <div class="tanxian">
                                <div class="tanxianclick" onclick="openPage('../public/choose_userpart.php?dom=man_cheng&type=user&single=2', '770px', '490px');"></div>
                                <div class="tanxiannei" id="man_cheng"></div>
                            </div>
                            <div class="tancheckdiv"><div class="tancheck" onclick="openPage('../public/choose_userpart.php?dom=man_cheng&type=user&single=2', '770px', '490px');"><i class="layui-icon layui-icon-search"></i></div></div>
                        </div>
                    </div>
                </div>
            </div>
            <div class="layui-form-item">
                <div class="layui-row layui-col-space10">
                    <div class="layui-col-md12">
                        <label class="layui-form-label">质安专员</label>
                        <div class="layui-input-block">
                            <div class="tanxian">
                                <div class="tanxianclick" onclick="openPage('../public/choose_userpart.php?dom=man_zhian&type=user&single=2', '770px', '490px');"></div>
                                <div class="tanxiannei" id="man_zhian"></div>
                            </div>
                            <div class="tancheckdiv"><div class="tancheck" onclick="openPage('../public/choose_userpart.php?dom=man_zhian&type=user&single=2', '770px', '490px');"><i class="layui-icon layui-icon-search"></i></div></div>
                        </div>
                    </div>
                </div>
            </div>
        </div>

        <div class="block-generic">
            <div style="font-size: 18px;font-weight: bold;text-align: center;margin-bottom: 20px">项目管理组-联营项目</div>
            <div class="layui-form-item">
                <div class="layui-row layui-col-space10">
                    <div class="layui-col-md12">
                        <label class="layui-form-label">项目专管员</label>
                        <div class="layui-input-block">
                            <div class="tanxian">
                                <div class="tanxianclick" onclick="openPage('../public/choose_userpart.php?dom=man_zhuan_lian&type=user&single=2', '770px', '490px');"></div>
                                <div class="tanxiannei" id="man_zhuan_lian"></div>
                            </div>
                            <div class="tancheckdiv"><div class="tancheck" onclick="openPage('../public/choose_userpart.php?dom=man_zhuan_lian&type=user&single=2', '770px', '490px');"><i class="layui-icon layui-icon-search"></i></div></div>
                        </div>
                    </div>
                </div>
            </div>
            <div class="layui-form-item">
                <div class="layui-row layui-col-space10">
                    <div class="layui-col-md12">
                        <label class="layui-form-label">资料专员</label>
                        <div class="layui-input-block">
                            <div class="tanxian">
                                <div class="tanxianclick" onclick="openPage('../public/choose_userpart.php?dom=man_zi_lian&type=user&single=2', '770px', '490px');"></div>
                                <div class="tanxiannei" id="man_zi_lian"></div>
                            </div>
                            <div class="tancheckdiv"><div class="tancheck" onclick="openPage('../public/choose_userpart.php?dom=man_zi_lian&type=user&single=2', '770px', '490px');"><i class="layui-icon layui-icon-search"></i></div></div>
                        </div>
                    </div>
                </div>
            </div>
            <div class="layui-form-item">
                <div class="layui-row layui-col-space10">
                    <div class="layui-col-md12">
                        <label class="layui-form-label">成本专员</label>
                        <div class="layui-input-block">
                            <div class="tanxian">
                                <div class="tanxianclick" onclick="openPage('../public/choose_userpart.php?dom=man_cheng_lian&type=user&single=2', '770px', '490px');"></div>
                                <div class="tanxiannei" id="man_cheng_lian"></div>
                            </div>
                            <div class="tancheckdiv"><div class="tancheck" onclick="openPage('../public/choose_userpart.php?dom=man_cheng_lian&type=user&single=2', '770px', '490px');"><i class="layui-icon layui-icon-search"></i></div></div>
                        </div>
                    </div>
                </div>
            </div>
            <div class="layui-form-item">
                <div class="layui-row layui-col-space10">
                    <div class="layui-col-md12">
                        <label class="layui-form-label">质安专员</label>
                        <div class="layui-input-block">
                            <div class="tanxian">
                                <div class="tanxianclick" onclick="openPage('../public/choose_userpart.php?dom=man_zhian_lian&type=user&single=2', '770px', '490px');"></div>
                                <div class="tanxiannei" id="man_zhian_lian"></div>
                            </div>
                            <div class="tancheckdiv"><div class="tancheck" onclick="openPage('../public/choose_userpart.php?dom=man_zhian_lian&type=user&single=2', '770px', '490px');"><i class="layui-icon layui-icon-search"></i></div></div>
                        </div>
                    </div>
                </div>
            </div>
        </div>

    </div>
</form>
<script>

    layui.use(['laytp', 'form'], function() {
        var form = layui.form, layer = layui.layer;
        render_input_attr();

        facade.ajax({type: 'get', url: ask_company_pei}).done(function(res){
            if (res.code === 2000) {
                var data = res.data;
                $("#man_created_user").html(data.man_created_user);
                $("#man_created_at").html(data.man_created_at);

                if(data.man_zhuan_info.length > 0){
                    tan_tags_init('#man_zhuan', data.man_zhuan_info);
                }
                if(data.man_zi_info.length > 0){
                    tan_tags_init('#man_zi', data.man_zi_info);
                }
                if(data.man_cheng_info.length > 0){
                    tan_tags_init('#man_cheng', data.man_cheng_info);
                }
                if(data.man_zhian_info.length > 0){
                    tan_tags_init('#man_zhian', data.man_zhian_info);
                }


                if(data.man_zhuan_lian_info.length > 0){
                    tan_tags_init('#man_zhuan_lian', data.man_zhuan_lian_info);
                }
                if(data.man_zi_lian_info.length > 0){
                    tan_tags_init('#man_zi_lian', data.man_zi_lian_info);
                }
                if(data.man_cheng_lian_info.length > 0){
                    tan_tags_init('#man_cheng_lian', data.man_cheng_lian_info);
                }
                if(data.man_zhian_lian_info.length > 0){
                    tan_tags_init('#man_zhian_lian', data.man_zhian_lian_info);
                }

                render_from();
            }
        });



        form.on('submit(add)', function(data){
            data.field.man_zhuan = tan_tags_getvalue("#man_zhuan", 'user');
            data.field.man_zi = tan_tags_getvalue("#man_zi", 'user');
            data.field.man_cheng = tan_tags_getvalue("#man_cheng", 'user');
            data.field.man_zhian = tan_tags_getvalue("#man_zhian", 'user');

            data.field.man_zhuan_lian = tan_tags_getvalue("#man_zhuan_lian", 'user');
            data.field.man_zi_lian = tan_tags_getvalue("#man_zi_lian", 'user');
            data.field.man_cheng_lian = tan_tags_getvalue("#man_cheng_lian", 'user');
            data.field.man_zhian_lian = tan_tags_getvalue("#man_zhian_lian", 'user');

            var validRes = true;

            if(!validRes){return false;}



            facade.ajax({url: ask_company_pei, data:data.field}).done(function(res){
                if (res.code === 2000) {
                    window.location.reload();
                }
            });

            return false;
        });

    });




</script>
</body>
</html>
